package com.app.client

import org.springframework.cloud.openfeign.FeignClient
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody

/**
 * Python服务的Feign客户端
 * name: 指定服务名称，与Sidecar中配置的服务名一致
 */
@FeignClient(name = "spring-sidecar")
interface PythonServiceClient {

    /**
     * 调用Python服务的hello接口
     */
    @GetMapping("/hello")
    fun hello(): Map<String, String>
    
    /**
     * 调用Python服务的数据处理接口
     */
    @PostMapping("/api/data")
    fun processData(@RequestBody data: Map<String, Any>): Map<String, Any>
}